<template>
	<view class="flex-col page">
		<view class="flex-col flex-auto section_3">
			<text class="self-center font_2 text_4">{{type==1?'《用户协议》':type==2?'《隐私协议》':'《入驻协议》'}}</text>
			<view class="flex-col group " v-html="content"></view>
		</view>
	</view>
</template>


<script setup>
	import {
		onShow,onLoad
	} from "@dcloudio/uni-app";
	import {
		onMounted,
		ref,
		reactive,
		getCurrentInstance
	} from "vue"
	const {
		proxy
	} = getCurrentInstance()
	let type = ref(1)
	let content = ref('')
	onLoad((option) => {
		type.value=option.type
		if(type.value==1){
			uni.setNavigationBarTitle({
				title: '用户协议'
			});
		}else if(type.value==2){
			uni.setNavigationBarTitle({
				title: '隐私协议'
			});
		}
		else if(type.value==3){
			uni.setNavigationBarTitle({
				title: '入驻协议'
			});
		}
		getDate()
	})
	const getDate=()=> {
		let api =type.value==1?proxy.$api.SystemInfo.userAgreement:type.value==2?proxy.$api.SystemInfo.PrivacyAgreement:proxy.$api.SystemInfo.rzAgreement
		proxy.$req.requestPOST(api).then(res => {
			if (res.flag == "success") {
				content.value = res.data.content
			} else {
				uni.showToast({
					title: res.message,
					icon: 'none'
				})
			}
		})
	}
	const toNotSign=()=>{
		uni.removeStorageSync('shop_id')
		uni.showToast({
			title:'退出成功！',
			icon:'none'
		})
		setTimeout(()=>{
			uni.navigateBack()
		},1500)
	}
</script>

<style scoped lang="scss">
	.page {
		background-color: #ffffff;
		width: 100%;
		overflow-y: auto;
		overflow-x: hidden;
		height: 100%;

		.section_3 {
			padding: 60rpx 36rpx 17rpx;
			background-color: #ffffff;
			overflow-y: auto;

			.font_2 {
				font-size: 36rpx;
				font-family: PingFang SC;
				color: #333333;
			}

			.text_4 {
				font-weight: 700;
				line-height: 35rpx;
			}

			.group {
				margin-right: 3rpx;
				margin-top: 64rpx;

				.text_5 {
					line-height: 29rpx;
				}

				.group_2 {
					margin-top: 39rpx;
				}

				.text_7 {
					margin-top: 41rpx;
				}

				.group_3 {
					margin-top: 22rpx;

					.image_6 {
						margin-left: 4rpx;
						width: 670rpx;
						height: 377rpx;
					}
				}

				.space-y-23 {

					&>view:not(:first-child),
					&>text:not(:first-child),
					&>image:not(:first-child) {
						margin-top: 23rpx;
					}
				}

				.font_4 {
					font-size: 28rpx;
					font-family: PingFang SC;
					line-height: 44rpx;
					font-weight: 700;
					color: #333333;
				}

				.text_6 {
					text-decoration: underline;
				}
			}

			.group_4 {
				margin-right: 3rpx;
				margin-top: 47rpx;
			}

			.space-y-22 {

				&>view:not(:first-child),
				&>text:not(:first-child),
				&>image:not(:first-child) {
					margin-top: 22rpx;
				}
			}

			.font_5 {
				font-size: 28rpx;
				font-family: PingFang SC;
				line-height: 28rpx;
				font-weight: 700;
				color: #333333;
			}

			.font_3 {
				font-size: 28rpx;
				font-family: PingFang SC;
				line-height: 44rpx;
				color: #9e9e9e;
			}
		}
	}
</style>